/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cz.muni.fi.pa165.library.api;

import java.util.List;

/**
 *
 * @author Filip Ligac
 */
public interface UserService {

    /**
     * Creates a new user and stores it into database.
     *
     * @param user user entity to be created
     * @return created user
     * @throws IllegalArgumentException if user is null or user's attributes
     * are not correct or sufficient
     */
    public UserTO createUser(UserTO user);
   
    /**
     * Finds a user according to given email.
     *
     * @param email email of entity to be found
     * @return found user
     * @throws IllegalArgumentException if username is null
     */
    public UserTO findUserByEmail(String email);

    /**
     * Deletes user from database.
     *
     * @param user user to be deleted
     * @return true if deleted successfully, false otherwise
     * @throws IllegalArgumentException if parameter is null
     */
    public void deleteUser(UserTO user);
   
    public void updateUser(UserTO user);
    
    public UserTO findUserById(Long id);
}
